package com.major.controller;

import com.major.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class UserController{

    @RequestMapping("/hello/world")
    public ModelAndView testMvc() {
        ModelAndView mv = new ModelAndView();
        User user = new User(1,"zhangsan张三");
        mv.addObject("user",user);
        mv.setViewName("hello");
        System.out.println(2);
        return mv;
    }
}
